package plus;

import java.util.*;

public class Scope<E> {
	private TreeMap<String, Symbol<E>> ns = new TreeMap<String, Symbol<E>>();
	public Symbol<E> find(String name) { return ns.get(name); }
	public Symbol<E> enter(Symbol<E> s) {
		if (ns.containsKey(s.name)) throw new Gripe("duplicate symbol name");
		ns.put(s.name, s);
		return s;
	}
}
